home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1256 / tour000.co_ / tour000.co
Text File  |  1997-04-18  |  11KB  |  259 lines

  1.       *---Created with EasyCODE(COB)----------------------------------- # EASY O
  2.       *---Last modification: 01.03.1995 14:22:33----------------------- # EASY K
  3.       *This program executes the events "Start" and "Shut" and carries \
  4.       *out file accesses.
  5.       *---------------------------------------------------------------- # EASY *
  6.       *---------------------------------------------------------------- # EASY (
  7.       *TOUR000
  8.       *---------------------------------------------------------------- # EASY *
  9.        IDENTIFICATION DIVISION.
  10.       *---------------------------------------------------------------- # EASY (
  11.       **** Identification Division ***
  12.       *---------------------------------------------------------------- # EASY *
  13.       *
  14.        PROGRAM-ID. TOUR000.
  15.       *
  16.       *        THIS PROGRAM PROCESSES THE EVENTS
  17.       *        "START" AND "SHUT" OF AN APPLICATION
  18.       *        AND HANDLES ALL FILE ACCESSES.
  19.       *
  20.       *---------------------------------------------------------------- # EASY )
  21.        ENVIRONMENT DIVISION.
  22.       *---------------------------------------------------------------- # EASY (
  23.       **** Environment Division ***
  24.       *---------------------------------------------------------------- # EASY *
  25.       *---------------------------------------------------------------- # EASY (
  26.       **** INPUT-OUTPUT Section ***
  27.       *---------------------------------------------------------------- # EASY *
  28.        INPUT-OUTPUT SECTION.
  29.        FILE-CONTROL.
  30.        SELECT JOURNEYS ASSIGN TO DA-590-I-SYS244
  31.           ORGANIZATION IS INDEXED ACCESS IS DYNAMIC
  32.           RECORD KEY IS JOURNEY-ID OF JOURNEY-RECORD.
  33.       
  34.        SELECT BOOKINGS ASSIGN TO DA-590-I-SYS244
  35.           ORGANIZATION IS INDEXED ACCESS IS DYNAMIC
  36.           RECORD KEY IS JOURNEY-ID OF BOOKING-RECORD.
  37.       *                                 # EASY S
  38.       *---------------------------------------------------------------- # EASY )
  39.       *---------------------------------------------------------------- # EASY )
  40.        DATA DIVISION.
  41.       *---------------------------------------------------------------- # EASY (
  42.       **** Data Division ***
  43.       *---------------------------------------------------------------- # EASY *
  44.       *---------------------------------------------------------------- # EASY (
  45.       **** FILE Section ***
  46.       *---------------------------------------------------------------- # EASY *
  47.        FILE SECTION.
  48.        FD  JOURNEYS LABEL RECORDS STANDARD.
  49.        01  JOURNEY-RECORD.
  50.        COPY JOURNEY.
  51.       *                                 # EASY -
  52.        FD  BOOKINGS LABEL RECORDS STANDARD.
  53.        01  BOOKING-RECORD.
  54.        COPY BOOKING.
  55.       *                                 # EASY S
  56.       *---------------------------------------------------------------- # EASY )
  57.       *---------------------------------------------------------------- # EASY (
  58.       **** WORKING-STORAGE Section ***
  59.       *---------------------------------------------------------------- # EASY *
  60.        WORKING-STORAGE SECTION.
  61.        77  STARTUP    PIC X(8) VALUE "STARTUP".
  62.        77  SHUTDOWN   PIC X(8) VALUE "SHUTDOWN".
  63.       *                                 # EASY S
  64.       *---------------------------------------------------------------- # EASY )
  65.       *---------------------------------------------------------------- # EASY (
  66.       **** LINKAGE Section ***
  67.       *---------------------------------------------------------------- # EASY *
  68.        LINKAGE SECTION.
  69.      COPY KCKBC SUPPRESS.
  70.        05 DUMMY   PIC X.
  71.      01  JOURNEY.
  72.          COPY JOURNEY.
  73.      01  BOOKING.
  74.          COPY BOOKING.
  75.      01  ERROR-SIGN    PIC 9.
  76.      01  EOF      PIC 9.
  77.       *                                 # EASY S
  78.       *---------------------------------------------------------------- # EASY )
  79.       *---------------------------------------------------------------- # EASY )
  80.        PROCEDURE DIVISION USING KCKBC.
  81.       *---------------------------------------------------------------- # EASY (
  82.       **** Procedure Division ***
  83.       *---------------------------------------------------------------- # EASY *
  84.       *---------------------------------------------------------------- # EASY (
  85.       **** MAIN ***
  86.       *---------------------------------------------------------------- # EASY *
  87.        MAIN.
  88.        IF KCTACVG = STARTUP
  89.        THEN
  90.           PERFORM OPEN-FILES
  91.        ELSE
  92.           IF KCTACVG = SHUTDOWN
  93.           THEN
  94.          PERFORM CLOSE-FILES
  95.           END-IF
  96.        END-IF
  97.        EXIT PROGRAM
  98.        .
  99.       *                                 # EASY P
  100.       *---------------------------------------------------------------- # EASY )
  101.       *---------------------------------------------------------------- # EASY (
  102.       **** OPEN-FILES ***
  103.       *---------------------------------------------------------------- # EASY *
  104.        OPEN-FILES.
  105.        OPEN I-O JOURNEYS
  106.       *                                 # EASY -
  107.        OPEN I-O BOOKINGS
  108.        .
  109.       *                                 # EASY P
  110.       *---------------------------------------------------------------- # EASY )
  111.       *---------------------------------------------------------------- # EASY (
  112.       **** CLOSE-FILES ***
  113.       *---------------------------------------------------------------- # EASY *
  114.        CLOSE-FILES.
  115.        CLOSE JOURNEYS
  116.       *                                 # EASY -
  117.        CLOSE BOOKINGS
  118.        .
  119.       *                                 # EASY P
  120.       *---------------------------------------------------------------- # EASY )
  121.       *---------------------------------------------------------------- # EASY (
  122.       **** WRITE-JOURNEY ***
  123.       *---------------------------------------------------------------- # EASY *
  124.        WRITE-JOURNEY.
  125.        ENTRY "WRJRNEY" USING JOURNEY, ERROR-SIGN.
  126.        MOVE 0 TO ERROR-SIGN
  127.        WRITE JOURNEY-RECORD FROM JOURNEY
  128.        INVALID KEY
  129.           MOVE 1 TO ERROR-SIGN
  130.        END-WRITE
  131.        EXIT PROGRAM
  132.        .
  133.       *                                 # EASY P
  134.       *---------------------------------------------------------------- # EASY )
  135.       *---------------------------------------------------------------- # EASY (
  136.       **** READ-JOURNEY-INDEXED ***
  137.       *---------------------------------------------------------------- # EASY *
  138.        READ-JOURNEY-INDEXED.
  139.        ENTRY "RDJRNEY" USING JOURNEY, ERROR-SIGN.
  140.        MOVE JOURNEY-ID OF JOURNEY TO JOURNEY-ID OF JOURNEY-RECORD
  141.       *                                 # EASY -
  142.        MOVE 0 TO ERROR-SIGN
  143.        READ JOURNEYS INTO JOURNEY
  144.        INVALID KEY
  145.           MOVE 1 TO ERROR-SIGN
  146.        END-READ
  147.        EXIT PROGRAM
  148.        .
  149.       *                                 # EASY P
  150.       *---------------------------------------------------------------- # EASY )
  151.       *---------------------------------------------------------------- # EASY (
  152.       **** READ-JOURNEY-SEQU ***
  153.       *---------------------------------------------------------------- # EASY *
  154.        READ-JOURNEY-SEQU.
  155.        ENTRY "NXTJRNEY" USING JOURNEY, EOF.
  156.        MOVE 0 TO EOF
  157.        READ JOURNEYS NEXT INTO JOURNEY
  158.        AT END
  159.           MOVE 1 TO EOF
  160.        END-READ
  161.        EXIT PROGRAM
  162.        .
  163.       *                                 # EASY P
  164.       *---------------------------------------------------------------- # EASY )
  165.       *---------------------------------------------------------------- # EASY (
  166.       **** POSITION-JOURNEY ***
  167.       *---------------------------------------------------------------- # EASY *
  168.        POSITION-JOURNEY.
  169.        ENTRY "POSJRNEY" USING JOURNEY, ERROR-SIGN.
  170.        MOVE JOURNEY-ID OF JOURNEY TO JOURNEY-ID OF JOURNEY-RECORD
  171.       *                                 # EASY -
  172.        MOVE 0 TO ERROR-SIGN
  173.        START JOURNEYS KEY NOT < JOURNEY-ID OF JOURNEY-RECORD
  174.        INVALID KEY
  175.           MOVE 1 TO ERROR-SIGN
  176.        END-START
  177.        EXIT PROGRAM
  178.        .
  179.       *                                 # EASY P
  180.       *---------------------------------------------------------------- # EASY )
  181.       *---------------------------------------------------------------- # EASY (
  182.       **** REPLACE-JOURNEY ***
  183.       *---------------------------------------------------------------- # EASY *
  184.        REPLACE-JOURNEY.
  185.        ENTRY "RWRJRNEY" USING JOURNEY, ERROR-SIGN.
  186.        MOVE 0 TO ERROR-SIGN
  187.        REWRITE JOURNEY-RECORD FROM JOURNEY
  188.        INVALID KEY
  189.           MOVE 1 TO ERROR-SIGN
  190.        END-REWRITE
  191.        EXIT PROGRAM
  192.        .
  193.       *                                 # EASY P
  194.       *---------------------------------------------------------------- # EASY )
  195.       *---------------------------------------------------------------- # EASY (
  196.       **** DELETE-JOURNEY ***
  197.       *---------------------------------------------------------------- # EASY *
  198.        DELETE-JOURNEY.
  199.        ENTRY "DELJRNEY" USING JOURNEY, ERROR-SIGN.
  200.        MOVE JOURNEY-ID OF JOURNEY TO JOURNEY-ID OF JOURNEY-RECORD
  201.       *                                 # EASY -
  202.        MOVE 0 TO ERROR-SIGN
  203.        DELETE JOURNEYS
  204.        INVALID KEY
  205.           MOVE 1 TO ERROR-SIGN
  206.        END-DELETE
  207.        EXIT PROGRAM
  208.        .
  209.       *                                 # EASY P
  210.       *---------------------------------------------------------------- # EASY )
  211.       *---------------------------------------------------------------- # EASY (
  212.       **** WRITE-BOOKING ***
  213.       *---------------------------------------------------------------- # EASY *
  214.        WRITE-BOOKING.
  215.        ENTRY "WRBOOKNG" USING BOOKING, ERROR-SIGN.
  216.        MOVE 0 TO ERROR-SIGN
  217.        WRITE BOOKING-RECORD FROM BOOKING
  218.        INVALID KEY
  219.           MOVE 1 TO ERROR-SIGN
  220.        END-WRITE
  221.        EXIT PROGRAM
  222.        .
  223.       *                                 # EASY P
  224.       *---------------------------------------------------------------- # EASY )
  225.       *---------------------------------------------------------------- # EASY (
  226.       **** READ-BOOKING-INDEXED ***
  227.       *---------------------------------------------------------------- # EASY *
  228.        READ-BOOKING-INDEXED.
  229.        ENTRY "RDBOOKNG" USING BOOKING, ERROR-SIGN.
  230.        MOVE JOURNEY-ID OF BOOKING TO
  231.        JOURNEY-ID OF BOOKING-RECORD
  232.       *                                 # EASY -
  233.        MOVE 0 TO ERROR-SIGN
  234.        READ BOOKINGS INTO BOOKING
  235.        INVALID KEY
  236.           MOVE 1 TO ERROR-SIGN
  237.        END-READ
  238.        EXIT PROGRAM
  239.        .
  240.       *                                 # EASY P
  241.       *---------------------------------------------------------------- # EASY )
  242.       *---------------------------------------------------------------- # EASY (
  243.       **** READ-BOOKING-SEQU ***
  244.       *---------------------------------------------------------------- # EASY *
  245.        READ-BOOKING-SEQU.
  246.        ENTRY "NXTBOOKNG" USING BOOKING, EOF.
  247.        MOVE 0 TO EOF
  248.        READ BOOKINGS NEXT INTO BOOKING
  249.        AT END
  250.           MOVE 1 TO EOF
  251.        END-READ
  252.        EXIT PROGRAM
  253.        .
  254.       *                                 # EASY P
  255.       *---------------------------------------------------------------- # EASY )
  256.       *---------------------------------------------------------------- # EASY )
  257.        END PROGRAM TOUR000.
  258.       *---------------------------------------------------------------- # EASY )
  259.